package cn.mw.cmdb.link.entity;

import cn.mw.cmdb.entity.*;
import cn.mw.components.mongodb.anno.AutoId;
import cn.mw.components.mongodb.anno.CMDBProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author gengjb
 * @description 线路信息
 * @date 2024/8/20 9:54
 */
@Getter
@Setter
@Schema(name = "MwNetWorkLinkDto", description = "线路信息")
@Document("mw_cmdbmd_link")
public class MwNetWorkLinkDto extends DataAuth implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "主键")
    @CMDBProperty(searchType = PropertyTypeString.ID, searchPrefix = "_", isShow = true)
    @AutoId
    private String id;

    @Schema(description = "线路ID")
    @CMDBProperty(searchType = PropertyTypeString.ID ,keywordSearch = true)
    private String linkId;

    @Schema(description = "线路名称")
    @CMDBProperty(searchType = PropertyTypeString.ID ,keywordSearch = true)
    private String linkName;

    @Schema(description = "线路分组")
    @CMDBProperty(searchType = PropertyTypeString.ID ,keywordSearch = true)
    private String linkGroup;

    @Schema(description = "源设备资产")
    @CMDBProperty(searchType = PropertyTypeString.ID ,keywordSearch = true)
    private String sourceDeviceAsset;

    @Schema(description = "源设备主机ID")
    @CMDBProperty(searchType = PropertyTypeString.ID ,keywordSearch = true)
    private String sourceDeviceHostId;

    @Schema(description = "源设备服务ID")
    @CMDBProperty(searchType = PropertyTypeString.ID ,keywordSearch = true)
    private Integer sourceDeviceServerId;

    @Schema(description = "源设备IP")
    @CMDBProperty(searchType = PropertyTypeString.ID ,keywordSearch = true)
    private String sourceDeviceIp;

    @Schema(description = "源设备端口")
    @CMDBProperty(searchType = PropertyTypeString.ID ,keywordSearch = true)
    private String sourceDevicePort;

    @Schema(description = "目标设备资产")
    @CMDBProperty(searchType = PropertyTypeString.ID ,keywordSearch = true)
    private String targetDeviceAsset;

    @Schema(description = "目标设备主机ID")
    @CMDBProperty(searchType = PropertyTypeString.ID ,keywordSearch = true)
    private String targetDeviceHostId;

    @Schema(description = "目标设备服务器ID")
    @CMDBProperty(searchType = PropertyTypeString.ID ,keywordSearch = true)
    private Integer targetDeviceServerId;

    @Schema(description = "目标设备IP")
    @CMDBProperty(searchType = PropertyTypeString.ID ,keywordSearch = true)
    private String targetDeviceIp;

    @Schema(description = "目标设备端口")
    @CMDBProperty(searchType = PropertyTypeString.ID ,keywordSearch = true)
    private String targetDevicePort;

    @Schema(description = "取数端口")
    @CMDBProperty(searchType = PropertyTypeString.ID ,keywordSearch = true)
    private String takeValuePort;

    @Schema(description = "带宽单位,ROOT:源，TARGET:目标")
    @CMDBProperty(searchType = PropertyTypeString.ID ,keywordSearch = true)
    private String bandWidthUnit;

    @Schema(description = "上行带宽")
    @CMDBProperty(searchType = PropertyTypeNumerical.ID ,keywordSearch = true)
    private Double upBandWidth;

    @Schema(description = "下行带宽")
    @CMDBProperty(searchType = PropertyTypeNumerical.ID ,keywordSearch = true)
    private Double downBandWidth;

    @Schema(description = "启用检测")
    @CMDBProperty(searchType = PropertyTypeSwitch.ID ,keywordSearch = true)
    private Boolean enableDetection;

    @Schema(description = "检测方式")
    @CMDBProperty(searchType = PropertyTypeString.ID ,keywordSearch = true)
    private String detectionWay;

    @Schema(description = "检测目标IP")
    @CMDBProperty(searchType = PropertyTypeString.ID ,keywordSearch = true)
    private String detectionTargetIp;

    @Schema(description = "服务器ID")
    @CMDBProperty(searchType = PropertyTypeInt.ID ,keywordSearch = true)
    private Integer monitorServerId;

    @Schema(description = "轮询引擎")
    @CMDBProperty(searchType = PropertyTypeString.ID ,keywordSearch = true)
    private String pollingEngine;

    @Schema(description = "代理类型")
    @CMDBProperty(searchType = PropertyTypeInt.ID ,keywordSearch = true)
    private String proxyType;

    @Schema(description = "状态")
    @Transient
    private String status;

    @Schema(description = "丢包率")
    @Transient
    private String lossRate;

    @Schema(description = "响应时间")
    @Transient
    private String responseTime;

    @Schema(description = "IN带宽利用率")
    @Transient
    private Double inLinkBandwidthUtilization;

    @Schema(description = "OUT带宽利用率")
    @Transient
    private Double outLinkBandwidthUtilization;

    @Schema(description = "检测目标IP的ID信息")
    @CMDBProperty(searchType = PropertyTypeString.ID ,keywordSearch = true)
    private String detectionTargetIpId;

    @Schema(description = "描述")
    @CMDBProperty(searchType = PropertyTypeString.ID ,keywordSearch = true)
    private String describe;

    @Schema(description = "关联数据")
    private List<LinkLabelDto> associationData;

    @CMDBProperty(searchType = PropertyTypeString.ID, keywordSearch = true)
    @Schema(description = "创建人")
    protected String creater;

    @CMDBProperty(searchType = PropertyTypeTime.ID)
    @Schema(description = "创建时间")
    protected Date createTime;

    @CMDBProperty(searchType = PropertyTypeString.ID, keywordSearch = true)
    @Schema(description = "修改人")
    protected String modifier;

    @CMDBProperty(searchType = PropertyTypeTime.ID)
    @Schema(description = "修改时间")
    protected Date modificationTime;
}
